home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / QuickTime VR / MacOS / QuickDraw™ 3D 1.0.6F4 SDK / Development / Interfaces / QD3DLight.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-14  |  8.7 KB  |  319 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **     Module:        QD3DLight.h                                                  **
  4.  **                                                                          **
  5.  **                                                                          **
  6.  **                                                                          **
  7.  **     Purpose:     Generic light routines                                      **
  8.  **                                                                          **
  9.  **                                                                          **
  10.  **     Copyright (C) 1991-1994 Apple Computer, Inc. All rights reserved.     **    
  11.  **                                                                          **
  12.  **                                                                             **
  13.  *****************************************************************************/
  14. #ifndef QD3DLight_h
  15. #define QD3DLight_h
  16.  
  17. #ifndef QD3D_h
  18. #include <QD3D.h>
  19. #endif  /*  QD3D_h  */
  20.  
  21. #if PRAGMA_ONCE
  22.     #pragma once
  23. #endif
  24.  
  25. #if defined(__MWERKS__)
  26.     #pragma enumsalwaysint on
  27.     #pragma align_array_members off
  28.     #pragma options align=native
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif    /* __cplusplus */
  34.  
  35. /******************************************************************************
  36.  **                                                                             **
  37.  **                            Enum Definitions                                 **
  38.  **                                                                             **
  39.  *****************************************************************************/
  40.  
  41. typedef enum TQ3AttenuationType {
  42.     kQ3AttenuationTypeNone,
  43.     kQ3AttenuationTypeInverseDistance,
  44.     kQ3AttenuationTypeInverseDistanceSquared
  45. } TQ3AttenuationType;
  46.  
  47.  
  48. typedef enum TQ3FallOffType {
  49.     kQ3FallOffTypeNone,
  50.     kQ3FallOffTypeLinear,
  51.     kQ3FallOffTypeExponential,
  52.     kQ3FallOffTypeCosine
  53. } TQ3FallOffType;
  54.  
  55.  
  56. /******************************************************************************
  57.  **                                                                             **
  58.  **                            Data Structure Definitions                         **
  59.  **                                                                             **
  60.  *****************************************************************************/
  61.  
  62. typedef struct TQ3LightData {
  63.     TQ3Boolean            isOn;
  64.     float                brightness;
  65.     TQ3ColorRGB            color;
  66. } TQ3LightData;
  67.  
  68. typedef struct TQ3DirectionalLightData {
  69.     TQ3LightData        lightData;
  70.     TQ3Boolean            castsShadows;
  71.     TQ3Vector3D            direction;
  72. } TQ3DirectionalLightData;
  73.  
  74. typedef struct TQ3PointLightData {
  75.     TQ3LightData        lightData;
  76.     TQ3Boolean            castsShadows;
  77.     TQ3AttenuationType    attenuation;
  78.     TQ3Point3D            location;
  79. } TQ3PointLightData;
  80.  
  81. typedef struct TQ3SpotLightData {
  82.     TQ3LightData        lightData;
  83.     TQ3Boolean            castsShadows;
  84.     TQ3AttenuationType    attenuation;
  85.     TQ3Point3D            location;
  86.     TQ3Vector3D            direction;
  87.     float                hotAngle;
  88.     float                outerAngle;
  89.     TQ3FallOffType        fallOff;
  90. } TQ3SpotLightData;
  91.  
  92.  
  93. /******************************************************************************
  94.  **                                                                             **
  95.  **                    Light routines (apply to all TQ3LightObjects)             **
  96.  **                                                                             **
  97.  *****************************************************************************/
  98.  
  99. QD3D_EXPORT TQ3ObjectType Q3Light_GetType(
  100.     TQ3LightObject        light);
  101.  
  102. QD3D_EXPORT TQ3Status Q3Light_GetState(
  103.     TQ3LightObject        light,
  104.     TQ3Boolean            *isOn);
  105.                 
  106. QD3D_EXPORT TQ3Status Q3Light_GetBrightness(
  107.     TQ3LightObject        light,
  108.     float                *brightness);
  109.     
  110. QD3D_EXPORT TQ3Status Q3Light_GetColor(
  111.     TQ3LightObject        light,
  112.     TQ3ColorRGB            *color);
  113.     
  114. QD3D_EXPORT TQ3Status Q3Light_SetState(
  115.     TQ3LightObject        light,
  116.     TQ3Boolean            isOn);
  117.                 
  118. QD3D_EXPORT TQ3Status Q3Light_SetBrightness(
  119.     TQ3LightObject        light,
  120.     float                brightness);
  121.     
  122. QD3D_EXPORT TQ3Status Q3Light_SetColor(
  123.     TQ3LightObject        light,
  124.     const TQ3ColorRGB    *color);
  125.  
  126. QD3D_EXPORT TQ3Status Q3Light_GetData(
  127.     TQ3LightObject        light,
  128.     TQ3LightData        *lightData);
  129.  
  130. QD3D_EXPORT TQ3Status Q3Light_SetData(
  131.     TQ3LightObject        light,
  132.     const TQ3LightData    *lightData);
  133.     
  134.  
  135. /******************************************************************************
  136.  **                                                                             **
  137.  **                            Specific Light Routines                               **
  138.  **                                                                             **
  139.  *****************************************************************************/
  140.  
  141. /******************************************************************************
  142.  **                                                                             **
  143.  **                            Ambient Light                                       **
  144.  **                                                                             **
  145.  *****************************************************************************/
  146.  
  147. QD3D_EXPORT TQ3LightObject Q3AmbientLight_New(
  148.     const TQ3LightData                *lightData);
  149.  
  150. QD3D_EXPORT TQ3Status Q3AmbientLight_GetData(
  151.     TQ3LightObject                    light,
  152.     TQ3LightData                    *lightData);
  153.  
  154. QD3D_EXPORT TQ3Status Q3AmbientLight_SetData(
  155.     TQ3LightObject                    light,
  156.     const TQ3LightData                *lightData);
  157.  
  158.  
  159. /******************************************************************************
  160.  **                                                                             **
  161.  **                        Directional Light                                     **
  162.  **                                                                             **
  163.  *****************************************************************************/
  164.  
  165. QD3D_EXPORT TQ3LightObject Q3DirectionalLight_New(
  166.     const TQ3DirectionalLightData    *directionalLightData);
  167.     
  168. QD3D_EXPORT TQ3Status Q3DirectionalLight_GetCastShadowsState(
  169.     TQ3LightObject                    light,
  170.     TQ3Boolean                        *castsShadows);
  171.     
  172. QD3D_EXPORT TQ3Status Q3DirectionalLight_GetDirection(
  173.     TQ3LightObject                    light,
  174.     TQ3Vector3D                        *direction);
  175.     
  176. QD3D_EXPORT TQ3Status Q3DirectionalLight_SetCastShadowsState(
  177.     TQ3LightObject                    light,
  178.     TQ3Boolean                        castsShadows);
  179.     
  180. QD3D_EXPORT TQ3Status Q3DirectionalLight_SetDirection(
  181.     TQ3LightObject                    light,
  182.     const TQ3Vector3D                *direction);
  183.  
  184. QD3D_EXPORT TQ3Status Q3DirectionalLight_GetData(
  185.     TQ3LightObject                    light,
  186.     TQ3DirectionalLightData            *directionalLightData);
  187.  
  188. QD3D_EXPORT TQ3Status Q3DirectionalLight_SetData(
  189.     TQ3LightObject                    light,
  190.     const TQ3DirectionalLightData    *directionalLightData);
  191.  
  192.  
  193. /******************************************************************************
  194.  **                                                                             **
  195.  **                        Point Light                                              **
  196.  **                                                                             **
  197.  *****************************************************************************/
  198.  
  199. QD3D_EXPORT TQ3LightObject Q3PointLight_New(
  200.     const TQ3PointLightData            *pointLightData);
  201.  
  202. QD3D_EXPORT TQ3Status Q3PointLight_GetCastShadowsState(
  203.     TQ3LightObject                    light,
  204.     TQ3Boolean                        *castsShadows);
  205.     
  206. QD3D_EXPORT TQ3Status Q3PointLight_GetAttenuation(
  207.     TQ3LightObject                    light,
  208.     TQ3AttenuationType                *attenuation);
  209.     
  210. QD3D_EXPORT TQ3Status Q3PointLight_GetLocation(
  211.     TQ3LightObject                    light,
  212.     TQ3Point3D                        *location);
  213.  
  214. QD3D_EXPORT TQ3Status Q3PointLight_GetData(
  215.     TQ3LightObject                    light,
  216.     TQ3PointLightData                *pointLightData);
  217.     
  218. QD3D_EXPORT TQ3Status Q3PointLight_SetCastShadowsState(
  219.     TQ3LightObject                    light,
  220.     TQ3Boolean                        castsShadows);
  221.     
  222. QD3D_EXPORT TQ3Status Q3PointLight_SetAttenuation(
  223.     TQ3LightObject                    light,
  224.     TQ3AttenuationType                attenuation);
  225.     
  226. QD3D_EXPORT TQ3Status Q3PointLight_SetLocation(
  227.     TQ3LightObject                    light,
  228.     const TQ3Point3D                *location);
  229.  
  230. QD3D_EXPORT TQ3Status Q3PointLight_SetData(
  231.     TQ3LightObject                    light,
  232.     const TQ3PointLightData            *pointLightData);
  233.     
  234.  
  235. /******************************************************************************
  236.  **                                                                             **
  237.  **                        Spot Light                                              **
  238.  **                                                                             **
  239.  *****************************************************************************/
  240.  
  241. QD3D_EXPORT TQ3LightObject Q3SpotLight_New(
  242.     const TQ3SpotLightData            *spotLightData);
  243.  
  244. QD3D_EXPORT TQ3Status Q3SpotLight_GetCastShadowsState(
  245.     TQ3LightObject                    light,
  246.     TQ3Boolean                        *castsShadows);
  247.     
  248. QD3D_EXPORT TQ3Status Q3SpotLight_GetAttenuation(
  249.     TQ3LightObject                    light,
  250.     TQ3AttenuationType                *attenuation);
  251.     
  252. QD3D_EXPORT TQ3Status Q3SpotLight_GetLocation(
  253.     TQ3LightObject                    light,
  254.     TQ3Point3D                        *location);
  255.         
  256. QD3D_EXPORT TQ3Status Q3SpotLight_GetDirection(
  257.     TQ3LightObject                    light,
  258.     TQ3Vector3D                        *direction);
  259.         
  260. QD3D_EXPORT TQ3Status Q3SpotLight_GetHotAngle(
  261.     TQ3LightObject                    light,
  262.     float                            *hotAngle);
  263.         
  264. QD3D_EXPORT TQ3Status Q3SpotLight_GetOuterAngle(
  265.     TQ3LightObject                    light,
  266.     float                            *outerAngle);
  267.         
  268. QD3D_EXPORT TQ3Status Q3SpotLight_GetFallOff(
  269.     TQ3LightObject                    light,
  270.     TQ3FallOffType                    *fallOff);
  271.  
  272. QD3D_EXPORT TQ3Status Q3SpotLight_GetData(
  273.     TQ3LightObject                    light,
  274.     TQ3SpotLightData                *spotLightData);
  275.  
  276. QD3D_EXPORT TQ3Status Q3SpotLight_SetCastShadowsState(
  277.     TQ3LightObject                    light,
  278.     TQ3Boolean                        castsShadows);
  279.     
  280. QD3D_EXPORT TQ3Status Q3SpotLight_SetAttenuation(
  281.     TQ3LightObject                    light,
  282.     TQ3AttenuationType                attenuation);
  283.     
  284. QD3D_EXPORT TQ3Status Q3SpotLight_SetLocation(
  285.     TQ3LightObject                    light,
  286.     const TQ3Point3D                *location);
  287.  
  288. QD3D_EXPORT TQ3Status Q3SpotLight_SetDirection(
  289.     TQ3LightObject                    light,
  290.     const TQ3Vector3D                *direction);
  291.  
  292. QD3D_EXPORT TQ3Status Q3SpotLight_SetHotAngle(
  293.     TQ3LightObject                    light,
  294.     float                            hotAngle);
  295.         
  296. QD3D_EXPORT TQ3Status Q3SpotLight_SetOuterAngle(
  297.     TQ3LightObject                    light,
  298.     float                            outerAngle);
  299.         
  300. QD3D_EXPORT TQ3Status Q3SpotLight_SetFallOff(
  301.     TQ3LightObject                    light,
  302.     TQ3FallOffType                    fallOff);
  303.  
  304. QD3D_EXPORT TQ3Status Q3SpotLight_SetData(
  305.     TQ3LightObject                    light,
  306.     const TQ3SpotLightData            *spotLightData);
  307.  
  308.  
  309. #ifdef __cplusplus
  310. }
  311. #endif    /* __cplusplus */
  312.  
  313. #if defined(__MWERKS__)
  314. #pragma options align=reset
  315. #pragma enumsalwaysint reset
  316. #endif
  317.  
  318. #endif  /*  QD3DLight_h  */
  319.